import 'package:flutter/material.dart';
import 'package:schoollifedemo/base/common_function.dart';
import 'package:schoollifedemo/commonwidget/button_widget.dart';
import 'package:schoollifedemo/commonwidget/common_base_widget.dart';
import 'package:schoollifedemo/commonwidget/text_widget_with_overflow.dart';

class CommonErrorWidget extends BaseStatelessWidget {
  final String _msg;
  final OnButtonClick? onButtonClick;

  const CommonErrorWidget(this._msg, {Key? key, this.onButtonClick})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        width: double.infinity,
        margin: const EdgeInsets.only(left: 50, right: 50),
        child: ButtonWidget(
          onButtonClick: onButtonClick,
          insideWidget: TextWidgetWithOverflow(
            _msg,
            fontSize: 16,
            maxLine: 1,
            insideColor: Colors.transparent,
            textColor: Colors.white,
          ),
          enableColor: const Color(0xFFE85252),
        ),
      ),
    );
  }
}
